Repository navigation
Phase 4: recovery with confirmation - #10
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Anyone allowed proposes a reset or force off; only the owner confirms it;
the hub runs it and checks the machine came back.
- Hub: recoveries in the state file (proposed, running, back, not_back,
off, done, failed, declined, withdrawn, expired). The hub proposes a
reset when a machine turns hung, once per hang. At most one runs per
machine per 30 minutes, the owner's direct buttons included. Proposals
are withdrawn when the machine answers or goes off and expire after 6
hours. A run cut short by a restart ends failed.
- Optional auto-reset (autoResetMinutes, off by default): confirms the
hub's reset proposal after N minutes while the machine is still hung.
Never for force off.
- API: POST /v2/machines/{name}/recoveries (power scope; agents subject
to the machine's Allow AI agents switch), GET /v2/recoveries[/{id}],
confirm (owner devices only) and decline (owner, or the proposer's
key). recovery events on SSE and webhooks; Machine.recovery.
- App: recovery card on the device page (Reset / Not now, running,
back, didn't come back with Force off); notification with Reset and
Not now that need an unlocked phone; the hub's Frozen machines setting.
- docs/protocol.md: Recoveries section.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4 of the recovery-layer plan: recovery with confirmation.
What changes
The hub (helper 2.4)
proposed,running,back,not_back,off,done,failed,declined,withdrawn,expired.hung, once per hang.failed.autoResetMinutes, off by default): the hub confirms its own reset proposal after N minutes while the machine is stillhung. Never for force off.POST /v2/machines/{name}/recoveriesneeds thepowerscope. Agents are also subject to the machine's Allow AI agents switch.GET /v2/recoveries[/{id}].POST …/confirmis for owner devices only. Agent keys and an owner hub relaying for an agent are refused.POST …/declineis for the owner, or the key that proposed it.recoveryevents on SSE and webhooks; webhooks get them by default.Machine.recovery, andhub.autoResetMinutesin status.App
setAuthenticationRequired). It replaces the plain "looks frozen" notification for that machine. Back, not back, failed, and auto or other-device confirms are notified too.Docs: a Recoveries section in docs/protocol.md, and the CHANGELOG entry for 2.4.0.
Tests
Hub state machine (fake clock, fake NanoKVM):
back;not_back, then off-and-on when the reset switch isn't wired;reset, and only while the machine is hung;failed.Mutating 8 of the safety rules each makes a test fail.
Server:
too_soonwithretryAt;agents_off;recoveryevents and the snapshot;Android:
🤖 Generated with Claude Code